1. Field of the Invention
The present invention relates to an information processing technology, and more particularly to an information processing apparatus and a method for carrying out the multi-thread processing.
2. Description of the Related Art
Information processing apparatuses available in the recent years include a multi-thread technology. In the multi-thread technology, not only a multitask environment where a plurality of processes can be simultaneously executed is achieved but also a parallel processing can be done in manner such that each process generates a plurality of threads inside the process. Each process is assigned its own unique resource and address space in the execution of the process, so that the process cannot access areas allocated to the other processes. In contrast to this, a thread is an executable unit or run unit that is generated within a process and therefore each thread can freely access each other's area inside the process. The thread is a basic processing unit to which an operating system allocates the execution time of CPU (central Processing Unit).
In such an environment where multiple threads are processed in parallel, an exclusive control can be achieved while the independency of the processor and the thread is maintained by providing queue storage in a shared memory and generating a waiting queue of threads requesting data and/or resource to be consumed.
Generally, when a certain thread is to retrieve data from the queue storage and when there is no data in the queue storage, the thread will be in a busy-wait state until new data is stored by another thread. While waiting, the CPU resource is wasted and this is problematic in that the processing efficiency as a whole drops as the frequency of occurrence of such a busy-wait state increases.
In the above-described technology, the thread must first be placed in the waiting queue by operating the queue storage when the thread requires access to data or resource. However, in order to ensure the consistency of data of waiting queue stored in the queue storage, a control mechanism needs to be employed in operating the queue storage itself. Accordingly, many procedures are required before the thread can finally access the data or resource.